⚡ Bolt: Optimize export foreign key lookups by using parsed handles - #786
⚡ Bolt: Optimize export foreign key lookups by using parsed handles#786seonghobae wants to merge 13 commits into
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
📝 WalkthroughWalkthrough핸들 ID에서 컬럼명을 직접 복원하는 ChangesFK 핸들 디코딩
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.jules/bolt.md:
- Around line 80-82: 엣지별 노드 컬럼 확인이 현재 .some 순회로 선형 탐색을 수행하므로 설명의 O(1) 주장과 구현이
일치하지 않습니다. FK 엣지 조회 로직에서 컬럼명을 담은 Set 인덱스를 먼저 구성하고, 각 조회가 해당 Set을 사용하도록 변경하십시오.
인덱스를 추가하지 않는 경우에는 선형 존재 확인이 유지된다는 내용으로 복잡도 설명을 갱신하십시오.
In `@frontend/src/erd/export.ts`:
- Around line 75-84: The edge-processing logic in frontend/src/erd/export.ts
lines 75-84 must replace per-edge columns.some checks with node-level Set
indexes built before the edge loop, then validate parsed source and target
columns using Set.has for O(1) lookup. Update .jules/bolt.md lines 80-82 to
document O(1) column lookup only after this Set-based indexing is implemented.
- Around line 75-88: Update the source and target handle checks in
fkColumnsForEdge to accept empty column names by testing parsedSource and
parsedTarget against null rather than truthiness, and use !== undefined for the
final resolved-column existence checks. Add focused fkColumnsForEdge tests
covering c-empty handles and preserving fallback behavior when handles cannot be
resolved.
In `@frontend/src/erd/handleUtils.ts`:
- Around line 33-40: Update the decoding logic around the visible split/map flow
in handleUtils so every token is validated as a complete hexadecimal code point
before calling parseInt; reject any token containing non-hex characters by
returning null, while preserving valid decoding and existing error handling. Add
a focused test covering encoded input such as src-c-0069junk-0064 and assert
that decoding returns null.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 039ce735-14df-4d2f-9c62-0da4c045d3f0
⛔ Files ignored due to path filters (1)
frontend/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (4)
.jules/bolt.mdfrontend/src/erd/export.tsfrontend/src/erd/handleUtils.test.tsfrontend/src/erd/handleUtils.ts
|
Closing as superseded by draft #700 at exact head |
Understood. Acknowledging that this work is now obsolete and stopping work on this task. |
Outcome
Foreign-key export now decodes bounded React Flow handle identifiers once and validates the decoded names through node-level column indexes. Repeated edges no longer rescan or re-encode every column.
Safety and correctness
Test-first evidence
The new repeated-edge regression failed on the predecessor implementation with
203column-name reads against the<20bound. After node-level indexing:Local verification used Node 24.14 while the package declares Node 26; repository CI remains authoritative for the supported runtime.
Merge boundary
Exact current head:
3cb4319c7050a4a32c464f751e837b0a23bfeedd.Merge only after current-head CI/security checks, zero valid unresolved findings, and a qualifying independent non-author approval satisfy repository policy. Synthetic-merge, predecessor-head, status-only, queued, or rate-limited evidence is not accepted.